package LinkHashSet;

import java.util.LinkedHashSet;

public class LinkHashSetDemo1 {
    public static void main(String[] args) {
        //有序,不重复,无索引
        //1.创建学生对象
        Student3 s1=new Student3("zhangsan",23);
        Student3 s2=new Student3("lisi",24);
        Student3 s3=new Student3("wangwu",25);
        Student3 s4=new Student3("zhangsan",23);
        //2.创建集合对象,并添加元素
        LinkedHashSet<Student3> lhs=new LinkedHashSet<>();
        lhs.add(s1);
        lhs.add(s2);
        lhs.add(s3);
        lhs.add(s4);
        System.out.println(lhs);
    }
}
